package com.hottv.meeting.videomeeting.module.white.data;

import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by chengwenqiang on 2019/6/3.
 */

public class ItemInfo {
    public int width = 0;
    public int height = 0;
    public String conversionFileUrl ="";
    public ItemInfo(int wid,int hei,String url)
    {
        width = wid;
        height = hei;
        conversionFileUrl = url;
    }

    public static ItemInfo  fromJson(JsonObject json)
    {
        ItemInfo info;
        try{
          int wid = json.get("width").getAsInt();
          int hei = json.get("height").getAsInt();
          String url = json.get("conversionFileUrl").getAsString();
            info = new ItemInfo(wid,hei,url);
        }catch (JsonIOException e)
        {
            e.printStackTrace();
            return null;
        }
       return info;
    }
}
